
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module Asterisk.Logging</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="Asterisk.html"><font color="#ffffff">Asterisk</font></a>.Logging</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/src/ks-voip/py-asterisk/Asterisk/Logging.py">/usr/src/ks-voip/py-asterisk/Asterisk/Logging.py</a></font></td></tr></table>
    <p><tt>Asterisk/Logging.py:&nbsp;extensions&nbsp;to&nbsp;the&nbsp;Python&nbsp;2.3&nbsp;logging&nbsp;module.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="logging.html">logging</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="logging.html#Logger">logging.Logger</a>(<a href="logging.html#Filterer">logging.Filterer</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="Asterisk.Logging.html#AsteriskLogger">AsteriskLogger</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="Asterisk.Logging.html#InstanceLogger">InstanceLogger</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="AsteriskLogger">class <strong>AsteriskLogger</strong></a>(<a href="logging.html#Logger">logging.Logger</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="Asterisk.Logging.html#AsteriskLogger">AsteriskLogger</a></dd>
<dd><a href="logging.html#Logger">logging.Logger</a></dd>
<dd><a href="logging.html#Filterer">logging.Filterer</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="AsteriskLogger-io"><strong>io</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;a&nbsp;message&nbsp;with&nbsp;severity&nbsp;'IO'&nbsp;on&nbsp;this&nbsp;logger.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-packet"><strong>packet</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;a&nbsp;message&nbsp;with&nbsp;severity&nbsp;'PACKET'&nbsp;on&nbsp;this&nbsp;logger.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-state"><strong>state</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;a&nbsp;message&nbsp;with&nbsp;severity&nbsp;'STATE'&nbsp;on&nbsp;this&nbsp;logger.</tt></dd></dl>

<hr>
Methods inherited from <a href="logging.html#Logger">logging.Logger</a>:<br>
<dl><dt><a name="AsteriskLogger-__init__"><strong>__init__</strong></a>(self, name, level<font color="#909090">=0</font>)</dt><dd><tt>Initialize&nbsp;the&nbsp;logger&nbsp;with&nbsp;a&nbsp;name&nbsp;and&nbsp;an&nbsp;optional&nbsp;level.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-addHandler"><strong>addHandler</strong></a>(self, hdlr)</dt><dd><tt>Add&nbsp;the&nbsp;specified&nbsp;handler&nbsp;to&nbsp;this&nbsp;logger.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-callHandlers"><strong>callHandlers</strong></a>(self, record)</dt><dd><tt>Pass&nbsp;a&nbsp;record&nbsp;to&nbsp;all&nbsp;relevant&nbsp;handlers.<br>
&nbsp;<br>
Loop&nbsp;through&nbsp;all&nbsp;handlers&nbsp;for&nbsp;this&nbsp;logger&nbsp;and&nbsp;its&nbsp;parents&nbsp;in&nbsp;the<br>
logger&nbsp;hierarchy.&nbsp;If&nbsp;no&nbsp;handler&nbsp;was&nbsp;found,&nbsp;output&nbsp;a&nbsp;one-off&nbsp;error<br>
message&nbsp;to&nbsp;sys.stderr.&nbsp;Stop&nbsp;searching&nbsp;up&nbsp;the&nbsp;hierarchy&nbsp;whenever&nbsp;a<br>
logger&nbsp;with&nbsp;the&nbsp;"propagate"&nbsp;attribute&nbsp;set&nbsp;to&nbsp;zero&nbsp;is&nbsp;found&nbsp;-&nbsp;that<br>
will&nbsp;be&nbsp;the&nbsp;last&nbsp;logger&nbsp;whose&nbsp;handlers&nbsp;are&nbsp;called.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-critical"><strong>critical</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'CRITICAL'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-critical">critical</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"major&nbsp;disaster",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-debug"><strong>debug</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'DEBUG'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-debug">debug</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"thorny&nbsp;problem",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-error"><strong>error</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'ERROR'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-error">error</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"major&nbsp;problem",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-exception"><strong>exception</strong></a>(self, msg, *args)</dt><dd><tt>Convenience&nbsp;method&nbsp;for&nbsp;logging&nbsp;an&nbsp;ERROR&nbsp;with&nbsp;exception&nbsp;information.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-fatal"><strong>fatal</strong></a> = critical(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'CRITICAL'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-critical">critical</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"major&nbsp;disaster",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-findCaller"><strong>findCaller</strong></a>(self)</dt><dd><tt>Find&nbsp;the&nbsp;stack&nbsp;frame&nbsp;of&nbsp;the&nbsp;caller&nbsp;so&nbsp;that&nbsp;we&nbsp;can&nbsp;note&nbsp;the&nbsp;source<br>
file&nbsp;name&nbsp;and&nbsp;line&nbsp;number.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-getEffectiveLevel"><strong>getEffectiveLevel</strong></a>(self)</dt><dd><tt>Get&nbsp;the&nbsp;effective&nbsp;level&nbsp;for&nbsp;this&nbsp;logger.<br>
&nbsp;<br>
Loop&nbsp;through&nbsp;this&nbsp;logger&nbsp;and&nbsp;its&nbsp;parents&nbsp;in&nbsp;the&nbsp;logger&nbsp;hierarchy,<br>
looking&nbsp;for&nbsp;a&nbsp;non-zero&nbsp;logging&nbsp;level.&nbsp;Return&nbsp;the&nbsp;first&nbsp;one&nbsp;found.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-handle"><strong>handle</strong></a>(self, record)</dt><dd><tt>Call&nbsp;the&nbsp;handlers&nbsp;for&nbsp;the&nbsp;specified&nbsp;record.<br>
&nbsp;<br>
This&nbsp;method&nbsp;is&nbsp;used&nbsp;for&nbsp;unpickled&nbsp;records&nbsp;received&nbsp;from&nbsp;a&nbsp;socket,&nbsp;as<br>
well&nbsp;as&nbsp;those&nbsp;created&nbsp;locally.&nbsp;<a href="logging.html#Logger">Logger</a>-level&nbsp;filtering&nbsp;is&nbsp;applied.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-info"><strong>info</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'INFO'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-info">info</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"interesting&nbsp;problem",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-isEnabledFor"><strong>isEnabledFor</strong></a>(self, level)</dt><dd><tt>Is&nbsp;this&nbsp;logger&nbsp;enabled&nbsp;for&nbsp;level&nbsp;'level'?</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-log"><strong>log</strong></a>(self, level, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;the&nbsp;severity&nbsp;'level'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-log">log</a>(level,&nbsp;"We&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"mysterious&nbsp;problem",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-makeRecord"><strong>makeRecord</strong></a>(self, name, level, fn, lno, msg, args, exc_info)</dt><dd><tt>A&nbsp;factory&nbsp;method&nbsp;which&nbsp;can&nbsp;be&nbsp;overridden&nbsp;in&nbsp;subclasses&nbsp;to&nbsp;create<br>
specialized&nbsp;LogRecords.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-removeHandler"><strong>removeHandler</strong></a>(self, hdlr)</dt><dd><tt>Remove&nbsp;the&nbsp;specified&nbsp;handler&nbsp;from&nbsp;this&nbsp;logger.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-setLevel"><strong>setLevel</strong></a>(self, level)</dt><dd><tt>Set&nbsp;the&nbsp;logging&nbsp;level&nbsp;of&nbsp;this&nbsp;logger.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-warn"><strong>warn</strong></a> = warning(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'WARNING'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-warning">warning</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"bit&nbsp;of&nbsp;a&nbsp;problem",&nbsp;exc_info=1)</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-warning"><strong>warning</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log&nbsp;'msg&nbsp;%&nbsp;args'&nbsp;with&nbsp;severity&nbsp;'WARNING'.<br>
&nbsp;<br>
To&nbsp;pass&nbsp;exception&nbsp;information,&nbsp;use&nbsp;the&nbsp;keyword&nbsp;argument&nbsp;exc_info&nbsp;with<br>
a&nbsp;true&nbsp;value,&nbsp;e.g.<br>
&nbsp;<br>
logger.<a href="#AsteriskLogger-warning">warning</a>("Houston,&nbsp;we&nbsp;have&nbsp;a&nbsp;%s",&nbsp;"bit&nbsp;of&nbsp;a&nbsp;problem",&nbsp;exc_info=1)</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="logging.html#Logger">logging.Logger</a>:<br>
<dl><dt><strong>manager</strong> = &lt;logging.Manager instance&gt;</dl>

<dl><dt><strong>root</strong> = &lt;logging.RootLogger instance&gt;</dl>

<hr>
Methods inherited from <a href="logging.html#Filterer">logging.Filterer</a>:<br>
<dl><dt><a name="AsteriskLogger-addFilter"><strong>addFilter</strong></a>(self, filter)</dt><dd><tt>Add&nbsp;the&nbsp;specified&nbsp;filter&nbsp;to&nbsp;this&nbsp;handler.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-filter"><strong>filter</strong></a>(self, record)</dt><dd><tt>Determine&nbsp;if&nbsp;a&nbsp;record&nbsp;is&nbsp;loggable&nbsp;by&nbsp;consulting&nbsp;all&nbsp;the&nbsp;filters.<br>
&nbsp;<br>
The&nbsp;default&nbsp;is&nbsp;to&nbsp;allow&nbsp;the&nbsp;record&nbsp;to&nbsp;be&nbsp;logged;&nbsp;any&nbsp;filter&nbsp;can&nbsp;veto<br>
this&nbsp;and&nbsp;the&nbsp;record&nbsp;is&nbsp;then&nbsp;dropped.&nbsp;Returns&nbsp;a&nbsp;zero&nbsp;value&nbsp;if&nbsp;a&nbsp;record<br>
is&nbsp;to&nbsp;be&nbsp;dropped,&nbsp;else&nbsp;non-zero.</tt></dd></dl>

<dl><dt><a name="AsteriskLogger-removeFilter"><strong>removeFilter</strong></a>(self, filter)</dt><dd><tt>Remove&nbsp;the&nbsp;specified&nbsp;filter&nbsp;from&nbsp;this&nbsp;handler.</tt></dd></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="InstanceLogger">class <strong>InstanceLogger</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="InstanceLogger-getLogger"><strong>getLogger</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;<a href="logging.html#Logger">Logger</a>&nbsp;instance&nbsp;which&nbsp;receives&nbsp;debug&nbsp;messages&nbsp;for&nbsp;this&nbsp;class<br>
instance.</tt></dd></dl>

<dl><dt><a name="InstanceLogger-getLoggerName"><strong>getLoggerName</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;name&nbsp;where&nbsp;log&nbsp;messages&nbsp;for&nbsp;this&nbsp;instance&nbsp;is&nbsp;sent.</tt></dd></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>

<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'InstanceLogger' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;defined)</tt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__Id__</strong> = '$Id: Asterisk.Logging.html 95 2004-10-06 19:19:42Z dw $'<br>
<strong>__author__</strong> = 'David M. Wilson &lt;dw-py-Asterisk-Util.py@botanicus.net&gt;'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">David&nbsp;M.&nbsp;Wilson&nbsp;&lt;dw-py-Asterisk-Util.py@botanicus.net&gt;</td></tr></table>
</body></html>